3.930 \(\int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx\)

Optimal. Leaf size=24 \[ x (b B-a C)+\frac {b C \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

(B*b-C*a)*x+b*C*arctanh(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 48, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {24, 3770} \[ x (b B-a C)+\frac {b C \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a*b*B - a^2*C + b^2*B*Sec[c + d*x] + b^2*C*Sec[c + d*x]^2)/(a + b*Sec[c + d*x]),x]

[Out]

(b*B - a*C)*x + (b*C*ArcTanh[Sin[c + d*x]])/d

Rule 24

Int[(u_.)*((a_) + (b_.)*(v_))^(m_)*((A_.) + (B_.)*(v_) + (C_.)*(v_)^2), x_Symbol] :> Dist[1/b^2, Int[u*(a + b*
v)^(m + 1)*Simp[b*B - a*C + b*C*v, x], x], x] /; FreeQ[{a, b, A, B, C}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0] &&
 LeQ[m, -1]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx &=\frac {\int \left (b^2 (b B-a C)+b^3 C \sec (c+d x)\right ) \, dx}{b^2}\\ &=(b B-a C) x+(b C) \int \sec (c+d x) \, dx\\ &=(b B-a C) x+\frac {b C \tanh ^{-1}(\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 23, normalized size = 0.96 \[ -a C x+b B x+\frac {b C \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*b*B - a^2*C + b^2*B*Sec[c + d*x] + b^2*C*Sec[c + d*x]^2)/(a + b*Sec[c + d*x]),x]

[Out]

b*B*x - a*C*x + (b*C*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

fricas [A]  time = 0.49, size = 45, normalized size = 1.88 \[ -\frac {2 \, {\left (C a - B b\right )} d x - C b \log \left (\sin \left (d x + c\right ) + 1\right ) + C b \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*sec(d*x+c)+b^2*C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(2*(C*a - B*b)*d*x - C*b*log(sin(d*x + c) + 1) + C*b*log(-sin(d*x + c) + 1))/d

________________________________________________________________________________________

giac [B]  time = 0.26, size = 53, normalized size = 2.21 \[ \frac {C b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - C b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - {\left (C a - B b\right )} {\left (d x + c\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*sec(d*x+c)+b^2*C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

(C*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - C*b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - (C*a - B*b)*(d*x + c))/d

________________________________________________________________________________________

maple [A]  time = 0.60, size = 46, normalized size = 1.92 \[ B x b -a C x +\frac {B b c}{d}+\frac {C b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {C a c}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*a*b-a^2*C+b^2*B*sec(d*x+c)+b^2*C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x)

[Out]

B*x*b-a*C*x+1/d*B*b*c+1/d*C*b*ln(sec(d*x+c)+tan(d*x+c))-1/d*C*a*c

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*sec(d*x+c)+b^2*C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more details)Is 4*a^2-4*b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 4.22, size = 258, normalized size = 10.75 \[ \frac {2\,C\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,B^2\,b^2-2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,B\,C\,a\,b+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,C^2\,a^2+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,C^2\,b^2}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B^2\,b^2-2\,B\,C\,a\,b+C^2\,a^2+C^2\,b^2\right )}\right )}{d}-\frac {2\,C\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,B^2\,b^2-2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,B\,C\,a\,b+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,C^2\,a^2+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,C^2\,b^2}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B^2\,b^2-2\,B\,C\,a\,b+C^2\,a^2+C^2\,b^2\right )}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((B*b^2)/cos(c + d*x) - C*a^2 + (C*b^2)/cos(c + d*x)^2 + B*a*b)/(a + b/cos(c + d*x)),x)

[Out]

(2*C*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*B*b*atan((B^2*b^2*sin(c/2 + (d*x)/2) + C^2*a^2*sin
(c/2 + (d*x)/2) + C^2*b^2*sin(c/2 + (d*x)/2) - 2*B*C*a*b*sin(c/2 + (d*x)/2))/(cos(c/2 + (d*x)/2)*(B^2*b^2 + C^
2*a^2 + C^2*b^2 - 2*B*C*a*b))))/d - (2*C*a*atan((B^2*b^2*sin(c/2 + (d*x)/2) + C^2*a^2*sin(c/2 + (d*x)/2) + C^2
*b^2*sin(c/2 + (d*x)/2) - 2*B*C*a*b*sin(c/2 + (d*x)/2))/(cos(c/2 + (d*x)/2)*(B^2*b^2 + C^2*a^2 + C^2*b^2 - 2*B
*C*a*b))))/d

________________________________________________________________________________________

sympy [A]  time = 4.23, size = 73, normalized size = 3.04 \[ \begin {cases} \frac {B b \left (c + d x\right ) - C a \left (c + d x\right ) + C b \log {\left (\tan {\left (c + d x \right )} + \sec {\left (c + d x \right )} \right )}}{d} & \text {for}\: d \neq 0 \\\frac {x \left (B a b + B b^{2} \sec {\relax (c )} - C a^{2} + C b^{2} \sec ^{2}{\relax (c )}\right )}{a + b \sec {\relax (c )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a**2*C+b**2*B*sec(d*x+c)+b**2*C*sec(d*x+c)**2)/(a+b*sec(d*x+c)),x)

[Out]

Piecewise(((B*b*(c + d*x) - C*a*(c + d*x) + C*b*log(tan(c + d*x) + sec(c + d*x)))/d, Ne(d, 0)), (x*(B*a*b + B*
b**2*sec(c) - C*a**2 + C*b**2*sec(c)**2)/(a + b*sec(c)), True))

________________________________________________________________________________________